
import axios from "axios"
// import axios from "@/utils/axios" //axios二次封装 需调试后开启

export const recommebdList = () => axios.get("/api/article/recommend");

export const tagsList = () => axios.get("/api/tag");

// export const articleList=()=>axios.get("/api/article")
//知识小册
export const knowledge = () => axios.get("/api/knowledge")
//知识小册跳详情
export const knowledgeDetail = (id) => axios.get(`/api/knowledge/${id}`)

// export const knowledgeDetail1=(id)=>axios.get(`/api/knowledge/${id}/views`)

export const articleList = () => axios.get("/api/article")

//article id 

export const articleDetail = (id) => axios.get(`/api/article/${id}`)
// api/article/recommend

export const articleRecommend = (id) => axios.get(`/api/article/recommend?articleId=${id}`)

//文章页面导航
export const categoryList = () => axios.get("/api/category")

//文章页面导航+id
export const categoryDeatail = (params) => axios.get(`/api/article/category/${params}`)

//搜索接口
export const get_search = (keyword) => axios.get('/api/search/article', { params: { keyword } });
//登录接口
// export const get_Login = () => axios.post('/api/user/password')
//跨域问题 ajax 和 fetch 会产生

//解决跨域
//留言板
export const gitMsgboard = () => axios.get('/api/comment')//留言板接口
//评论列表
export const getCommentList = (detailId, params) => axios.get('/api/comment/host/' + detailId, {
    params
})
//关于
export const getAboutData = () => axios.post('/api/setting/get')
//关于评论接口
export const gitAboutComments = () => axios.get('api/comment')




//跨域问题 ajax 和 fetch 会产生
//解决跨域  
//1.开发环境 webpack -dev-server proxy 配置会帮助我们实现反向代理